home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
mntlib43
/
mntlib
/
clock.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-15
|
814b
|
43 lines
/* _clock -- return process time used so far, in units of CLK_TCK ticks
per second (under TOS, 200 per second) */
/* written by ERS */
#include <time.h>
#include <osbind.h>
extern clock_t _starttime; /* in main.c */
static clock_t now;
/* this must execute in supervisor mode; it fetches the system variable
* containing the number of 200HZ ticks since the system was booted
*/
static long getnow __PROTO((void));
static long
getnow()
{
now = *((unsigned long *) 0x4baL);
return 0;
}
clock_t
_clock()
{
(void)Supexec(getnow);
return (now - _starttime);
}
/* This next bit of nonsense is temporary...clock() should be fixed! */
#ifdef __GNUC__
asm(".stabs \"_clock\",5,0,0,__clock"); /* dept of clean tricks */
#else /* ! __GNUC__ */
clock_t
clock()
{
return _clock();
}
#endif /* ! __GNUC__ */